Skip to content

Use merge base for lintdiff comparison instead of main tip#4981

Merged
denik merged 1 commit intomainfrom
denik/lintdiff-merge-commit
Apr 20, 2026
Merged

Use merge base for lintdiff comparison instead of main tip#4981
denik merged 1 commit intomainfrom
denik/lintdiff-merge-commit

Conversation

@denik
Copy link
Copy Markdown
Contributor

@denik denik commented Apr 15, 2026

Changes

  • lintdiff.py now uses git merge-base to find the branch point before computing changed files, instead of diffing against the ref tip directly.

Why

When main advances after a branch is created, git diff main includes files changed on main since the branch point. This causes make lint to flag issues in files the branch author never touched.

Tests

No automated tests — lintdiff.py is a thin wrapper around git + golangci-lint with no existing test infrastructure. Verified manually.

@denik denik enabled auto-merge April 15, 2026 16:20
@denik denik requested a review from pietern April 16, 2026 14:17
@denik denik force-pushed the denik/lintdiff-merge-commit branch from 4a1a7a3 to ca50ce0 Compare April 19, 2026 12:03
This ensures lintdiff only picks up files changed on the current
branch, not files that changed on main since the branch point.

Task: 001.md

Co-authored-by: Isaac
@denik denik force-pushed the denik/lintdiff-merge-commit branch from ca50ce0 to d6e6ae4 Compare April 19, 2026 13:44
Copy link
Copy Markdown
Contributor

@janniklasrose janniklasrose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@denik denik added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit 363f15b Apr 20, 2026
24 checks passed
@denik denik deleted the denik/lintdiff-merge-commit branch April 20, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants